import { dom, Nodes } from '@knno/dom';
import { loadingStyle } from './loading.css';
import SVGLoading from '../../svg/loading.svg';
import SVGLoadingDot from '../../svg/loading-dot.svg';

export function loading(...className: string[]): Nodes {
	return dom
		.div(loadingStyle)
		.addClass(...className)
		.append(
			dom.html(SVGLoading).css({
				width: 'auto',
				height: 'auto',
			})
		);
}

export function loadingDot(...className: string[]): Nodes {
	return dom
		.div(loadingStyle, 'dot')
		.addClass(...className)
		.append(
			dom.html(SVGLoadingDot).css({
				width: 'auto',
				height: 'auto',
			})
		);
}
